/*     */ package eos.moe.dragoncore;
/*     */ import java.awt.Color;
/*     */ import java.util.ArrayList;
/*     */ import java.util.List;
/*     */ import javax.annotation.Nullable;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.gui.FontRenderer;
/*     */ import net.minecraft.client.gui.ScaledResolution;
/*     */ import net.minecraft.client.renderer.BufferBuilder;
/*     */ import net.minecraft.client.renderer.EntityRenderer;
/*     */ import net.minecraft.client.renderer.GlStateManager;
/*     */ import net.minecraft.client.renderer.RenderHelper;
/*     */ import net.minecraft.client.renderer.RenderItem;
/*     */ import net.minecraft.client.renderer.Tessellator;
/*     */ import net.minecraft.client.renderer.block.model.BakedQuad;
/*     */ import net.minecraft.client.renderer.block.model.IBakedModel;
/*     */ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
/*     */ import net.minecraft.client.renderer.texture.TextureManager;
/*     */ import net.minecraft.client.renderer.texture.TextureMap;
/*     */ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
/*     */ import net.minecraft.crash.CrashReport;
/*     */ import net.minecraft.crash.CrashReportCategory;
/*     */ import net.minecraft.entity.EntityLivingBase;
/*     */ import net.minecraft.item.ItemStack;
/*     */ import net.minecraft.util.EnumFacing;
/*     */ import net.minecraftforge.client.ForgeHooksClient;
/*     */ import net.minecraftforge.client.event.RenderTooltipEvent;
/*     */ import net.minecraftforge.common.MinecraftForge;
/*     */ import net.minecraftforge.fml.client.config.GuiUtils;
/*     */ import net.minecraftforge.fml.common.eventhandler.Event;
/*     */ import org.lwjgl.opengl.GL11;
/*     */ 
/*     */ public class jo {
/*     */   private static float q;
/*     */   
/*     */   public static float v() {
/*  37 */     return q;
/*     */   }
/*     */   public static String g;
/*     */   public static void v(float a) {
/*  41 */     q = Math.min(1.0F, Math.max(0.0F, a));
/*     */   }
/*     */   
/*     */   public static void v(double a, double d1, double d2, double d3) {
/*  45 */     v(a, d1, 0.0D, 0.0D, d2, d3, d2, d3);
/*     */   }
/*     */   
/*     */   public static void v(double a, double d1, double d2, double d3, double d4, double d5, double d6, double d7) {
/*  49 */     GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, q);
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*  60 */     float f1 = (float)(1.0D / d6);
/*  61 */     float f2 = (float)(1.0D / d7);
/*  62 */     Tessellator tessellator = Tessellator.func_178181_a();
/*  63 */     BufferBuilder bufferBuilder = tessellator.func_178180_c();
/*  64 */     bufferBuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*  71 */     bufferBuilder.func_181662_b(a, d1 + d5, 0.0D).func_187315_a(d2 * f1, (d3 + d5) * f2).func_181675_d();
/*  72 */     bufferBuilder.func_181662_b(a + d4, d1 + d5, 0.0D).func_187315_a((d2 + d4) * f1, (d3 + d5) * f2).func_181675_d();
/*  73 */     bufferBuilder.func_181662_b(a + d4, d1, 0.0D).func_187315_a((d2 + d4) * f1, d3 * f2).func_181675_d();
/*  74 */     bufferBuilder.func_181662_b(a, d1, 0.0D).func_187315_a(d2 * f1, d3 * f2).func_181675_d();
/*  75 */     tessellator.func_78381_a();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(double a, double d1, double d2, double d3, Color color) {
/*  82 */     int i = (int)(color.getAlpha() * q);
/*  83 */     int j = v(new Color(color.getRed(), color.getGreen(), color.getBlue(), i));
/*  84 */     v(a, d1, d2, d3, j);
/*     */   }
/*     */   
/*     */   public static void v(double a, double d1, double d2, double d3, int i) {
/*  88 */     float f1 = (i >> 24 & 0xFF) / 255.0F * Math.min(1.0F, Math.max(0.0F, q));
/*  89 */     float f2 = (i >> 16 & 0xFF) / 255.0F;
/*  90 */     float f3 = (i >> 8 & 0xFF) / 255.0F;
/*  91 */     float f4 = (i & 0xFF) / 255.0F;
/*  92 */     Tessellator tessellator = Tessellator.func_178181_a();
/*  93 */     BufferBuilder bufferBuilder = tessellator.func_178180_c();
/*  94 */     GlStateManager.func_179147_l();
/*  95 */     GlStateManager.func_179090_x();
/*  96 */     GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
/*  97 */     GlStateManager.func_179131_c(f2, f3, f4, f1);
/*  98 */     bufferBuilder.func_181668_a(7, DefaultVertexFormats.field_181705_e);
/*  99 */     bufferBuilder.func_181662_b(a, d1 + d3, 0.0D).func_181675_d();
/* 100 */     bufferBuilder.func_181662_b(a + d2, d1 + d3, 0.0D).func_181675_d();
/* 101 */     bufferBuilder.func_181662_b(a + d2, d1, 0.0D).func_181675_d();
/* 102 */     bufferBuilder.func_181662_b(a, d1, 0.0D).func_181675_d();
/* 103 */     tessellator.func_78381_a();
/* 104 */     GlStateManager.func_179098_w();
/* 105 */     GlStateManager.func_179084_k();
/*     */   }
/*     */   
/*     */   public static void v(double a, double d1, double d2, double d3, double d4, Color color) {
/* 109 */     int i = v(new Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()));
/* 110 */     v(a, d1, d2, d4, i);
/* 111 */     v(a, d1, d4, d3, i);
/* 112 */     v(a + d2 - d4, d1, d4, d3, i);
/* 113 */     v(a, d1 + d3 - d4, d2, d4, i);
/*     */   }
/*     */   
/*     */   public static void v(int a, int i, int j, int k) {
/* 117 */     int m = i + k;
/* 118 */     ScaledResolution scaledResolution = new ScaledResolution(Minecraft.func_71410_x());
/* 119 */     int n = scaledResolution.func_78325_e();
/* 120 */     int i1 = scaledResolution.func_78328_b() - m;
/* 121 */     GL11.glScissor(a * n, i1 * n, j * n, k * n);
/*     */   }
/*     */   
/*     */   public static int v(Color a) {
/* 125 */     return a.getBlue() | a.getGreen() << 8 | a.getRed() << 16 | a.getAlpha() << 24;
/*     */   }
/*     */   
/*     */   public static void v(@Nonnull ItemStack stack, List<String> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font) {
/* 129 */     if (!textLines.isEmpty()) {
/*     */       
/* 131 */       RenderTooltipEvent.Pre a = new RenderTooltipEvent.Pre(stack, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth, font);
/* 132 */       if (MinecraftForge.EVENT_BUS.post((Event)a)) {
/*     */         return;
/*     */       }
/*     */       
/* 136 */       mouseX = a.getX();
/* 137 */       mouseY = a.getY();
/*     */       
/* 139 */       screenWidth = a.getScreenWidth();
/* 140 */       screenHeight = a.getScreenHeight();
/* 141 */       maxTextWidth = a.getMaxWidth();
/* 142 */       font = a.getFontRenderer();
/*     */       
/* 144 */       GlStateManager.func_179101_C();
/* 145 */       RenderHelper.func_74518_a();
/* 146 */       GlStateManager.func_179140_f();
/* 147 */       GlStateManager.func_179097_i();
/* 148 */       int i = 0;
/*     */       
/* 150 */       for (String str : textLines) {
/* 151 */         int i7 = font.func_78256_a(str);
/*     */         
/* 153 */         if (i7 > i) {
/* 154 */           i = i7;
/*     */         }
/*     */       } 
/*     */       
/* 158 */       boolean bool = false;
/*     */       
/* 160 */       int j = 1;
/* 161 */       int k = mouseX + 12;
/* 162 */       if (k + i + 4 > screenWidth) {
/* 163 */         k = mouseX - 16 - i;
/* 164 */         if (k < 4) {
/*     */           
/* 166 */           if (mouseX > screenWidth / 2) {
/* 167 */             i = mouseX - 12 - 8;
/*     */           } else {
/* 169 */             i = screenWidth - 16 - mouseX;
/*     */           } 
/* 171 */           bool = true;
/*     */         } 
/*     */       } 
/*     */       
/* 175 */       if (maxTextWidth > 0 && i > maxTextWidth) {
/* 176 */         i = maxTextWidth;
/* 177 */         bool = true;
/*     */       } 
/*     */       
/* 180 */       if (bool) {
/* 181 */         int i7 = 0;
/* 182 */         List<String> list = new ArrayList();
/* 183 */         for (int i8 = 0; i8 < textLines.size(); i8++) {
/* 184 */           String str = textLines.get(i8);
/* 185 */           List list1 = font.func_78271_c(str, i);
/* 186 */           if (i8 == 0) {
/* 187 */             j = list1.size();
/*     */           }
/*     */           
/* 190 */           for (String str1 : list1) {
/* 191 */             int i9 = font.func_78256_a(str1);
/* 192 */             if (i9 > i7) {
/* 193 */               i7 = i9;
/*     */             }
/* 195 */             list.add(str1);
/*     */           } 
/*     */         } 
/* 198 */         i = i7;
/* 199 */         textLines = list;
/*     */         
/* 201 */         if (mouseX > screenWidth / 2) {
/* 202 */           k = mouseX - 16 - i;
/*     */         } else {
/* 204 */           k = mouseX + 12;
/*     */         } 
/*     */       } 
/*     */       
/* 208 */       int m = mouseY - 12;
/* 209 */       int n = 8;
/*     */       
/* 211 */       if (textLines.size() > 1) {
/* 212 */         n += (textLines.size() - 1) * 10;
/* 213 */         if (textLines.size() > j) {
/* 214 */           n += 2;
/*     */         }
/*     */       } 
/*     */       
/* 218 */       if (m < 4) {
/* 219 */         m = 4;
/* 220 */       } else if (m + n + 4 > screenHeight) {
/* 221 */         m = screenHeight - n - 4;
/*     */       } 
/*     */       
/* 224 */       int i1 = 300;
/* 225 */       int i2 = -267386864;
/* 226 */       int i3 = 1347420415;
/* 227 */       int i4 = (i3 & 0xFEFEFE) >> 1 | i3 & 0xFF000000;
/* 228 */       RenderTooltipEvent.Color color = new RenderTooltipEvent.Color(stack, textLines, k, m, font, i2, i3, i4);
/* 229 */       MinecraftForge.EVENT_BUS.post((Event)color);
/* 230 */       i2 = color.getBackground();
/* 231 */       i3 = color.getBorderStart();
/* 232 */       i4 = color.getBorderEnd();
/* 233 */       GuiUtils.drawGradientRect(300, k - 3, m - 4, k + i + 3, m - 3, i2, i2);
/* 234 */       GuiUtils.drawGradientRect(300, k - 3, m + n + 3, k + i + 3, m + n + 4, i2, i2);
/* 235 */       GuiUtils.drawGradientRect(300, k - 3, m - 3, k + i + 3, m + n + 3, i2, i2);
/* 236 */       GuiUtils.drawGradientRect(300, k - 4, m - 3, k - 3, m + n + 3, i2, i2);
/* 237 */       GuiUtils.drawGradientRect(300, k + i + 3, m - 3, k + i + 4, m + n + 3, i2, i2);
/* 238 */       GuiUtils.drawGradientRect(300, k - 3, m - 3 + 1, k - 3 + 1, m + n + 3 - 1, i3, i4);
/* 239 */       GuiUtils.drawGradientRect(300, k + i + 2, m - 3 + 1, k + i + 3, m + n + 3 - 1, i3, i4);
/* 240 */       GuiUtils.drawGradientRect(300, k - 3, m - 3, k + i + 3, m - 3 + 1, i3, i3);
/* 241 */       GuiUtils.drawGradientRect(300, k - 3, m + n + 2, k + i + 3, m + n + 3, i4, i4);
/*     */       
/* 243 */       MinecraftForge.EVENT_BUS.post((Event)new RenderTooltipEvent.PostBackground(stack, textLines, k, m, font, i, n));
/* 244 */       int i5 = m;
/*     */       
/* 246 */       for (int i6 = 0; i6 < textLines.size(); i6++) {
/* 247 */         String str = textLines.get(i6);
/* 248 */         af.v(str, null, k, m, false, true, false, -1);
/*     */         
/* 250 */         if (i6 + 1 == j) {
/* 251 */           m += 2;
/*     */         }
/*     */         
/* 254 */         m += 10;
/*     */       } 
/*     */       
/* 257 */       MinecraftForge.EVENT_BUS.post((Event)new RenderTooltipEvent.PostText(stack, textLines, k, i5, font, i, n));
/*     */       
/* 259 */       GlStateManager.func_179145_e();
/* 260 */       GlStateManager.func_179126_j();
/* 261 */       RenderHelper.func_74519_b();
/* 262 */       GlStateManager.func_179091_B();
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(@Nullable EntityLivingBase p_184391_1_, ItemStack p_184391_2_, int p_184391_3_, int p_184391_4_) {
/* 269 */     RenderItem a = Minecraft.func_71410_x().func_175599_af();
/*     */     
/* 271 */     if (!p_184391_2_.func_190926_b()) {
/* 272 */       a.field_77023_b += 50.0F;
/*     */       
/*     */       try {
/* 275 */         v(p_184391_2_, p_184391_3_, p_184391_4_, a.func_184393_a(p_184391_2_, null, p_184391_1_));
/* 276 */       } catch (Throwable throwable) {
/* 277 */         CrashReport crashReport = CrashReport.func_85055_a(throwable, "Rendering item");
/* 278 */         CrashReportCategory crashReportCategory = crashReport.func_85058_a("Item being rendered");
/* 279 */         crashReportCategory.func_189529_a("Item Type", new wm(p_184391_2_));
/*     */ 
/*     */ 
/*     */ 
/*     */         
/* 284 */         crashReportCategory.func_189529_a("Registry Name", () -> String.valueOf(a.func_77973_b().getRegistryName()));
/* 285 */         crashReportCategory.func_189529_a("Item Aux", new rg(p_184391_2_));
/*     */ 
/*     */ 
/*     */ 
/*     */         
/* 290 */         crashReportCategory.func_189529_a("Item NBT", new un(p_184391_2_));
/*     */ 
/*     */ 
/*     */ 
/*     */         
/* 295 */         crashReportCategory.func_189529_a("Item Foil", new cf(p_184391_2_));
/*     */ 
/*     */ 
/*     */ 
/*     */         
/* 300 */         throw new ReportedException(crashReport);
/*     */       } 
/*     */       
/* 303 */       a.field_77023_b -= 50.0F;
/*     */     } 
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v(ItemStack a, int i, int j, IBakedModel iBakedModel) {
/* 309 */     RenderItem renderItem = Minecraft.func_71410_x().func_175599_af();
/* 310 */     TextureManager textureManager = Minecraft.func_71410_x().func_110434_K();
/*     */     
/* 312 */     GlStateManager.func_179094_E();
/* 313 */     textureManager.func_110577_a(TextureMap.field_110575_b);
/* 314 */     textureManager.func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
/* 315 */     GlStateManager.func_179091_B();
/* 316 */     GlStateManager.func_179141_d();
/* 317 */     GlStateManager.func_179092_a(516, 0.1F);
/* 318 */     GlStateManager.func_179147_l();
/* 319 */     GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
/* 320 */     GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
/* 321 */     v(i, j, iBakedModel.func_177556_c());
/* 322 */     iBakedModel = ForgeHooksClient.handleCameraTransforms(iBakedModel, ItemCameraTransforms.TransformType.GUI, false);
/*     */     
/* 324 */     renderItem(a, iBakedModel);
/* 325 */     GlStateManager.func_179118_c();
/* 326 */     GlStateManager.func_179101_C();
/* 327 */     GlStateManager.func_179140_f();
/* 328 */     GlStateManager.func_179121_F();
/* 329 */     textureManager.func_110577_a(TextureMap.field_110575_b);
/* 330 */     textureManager.func_110581_b(TextureMap.field_110575_b).func_174935_a();
/*     */   }
/*     */   
/*     */   public static void renderItem(ItemStack a, IBakedModel iBakedModel) {
/* 334 */     if (!a.func_190926_b()) {
/* 335 */       GlStateManager.func_179094_E();
/* 336 */       GlStateManager.func_179109_b(-0.5F, -0.5F, -0.5F);
/*     */       
/* 338 */       if (iBakedModel.func_188618_c()) {
/* 339 */         GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
/* 340 */         GlStateManager.func_179091_B();
/* 341 */         a.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(a);
/*     */       } else {
/* 343 */         int i = 0xFFFFFF | (int)(Math.min(1.0F, Math.max(0.0F, q)) * 255.0F) << 24;
/* 344 */         v(iBakedModel, i, a);
/*     */       } 
/*     */       
/* 347 */       GlStateManager.func_179121_F();
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static Color v(String a) {
/* 472 */     String[] arrayOfString = a.split(",");
/*     */     try {
/* 474 */       if (arrayOfString.length >= 4) {
/* 475 */         return new Color(
/* 476 */             (int)sk.v(Double.parseDouble(arrayOfString[0]), 0.0D, 255.0D), 
/* 477 */             (int)sk.v(Double.parseDouble(arrayOfString[1]), 0.0D, 255.0D), 
/* 478 */             (int)sk.v(Double.parseDouble(arrayOfString[2]), 0.0D, 255.0D), 
/* 479 */             (int)sk.v(Double.parseDouble(arrayOfString[3]), 0.0D, 255.0D));
/*     */       }
/* 481 */       if (arrayOfString.length >= 3) {
/* 482 */         return new Color(
/* 483 */             (int)sk.v(Double.parseDouble(arrayOfString[0]), 0.0D, 255.0D), 
/* 484 */             (int)sk.v(Double.parseDouble(arrayOfString[1]), 0.0D, 255.0D), 
/* 485 */             (int)sk.v(Double.parseDouble(arrayOfString[2]), 0.0D, 255.0D));
/*     */       }
/*     */     }
/* 488 */     catch (Exception exception) {}
/*     */ 
/*     */     
/* 491 */     return null;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\jo.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */